{% trans_default_domain 'FOSUserBundle' %}

<div class="register-box-body">
    <p class="login-box-msg">注册账号</p>

    {{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register')}) }}
        {% for flashMessage in app.session.flashbag.get('notice') %}
            <span class="black-text"><p>{{ flashMessage }}</p></span>
        {% endfor %}

        <div class="form-group has-feedback">
            {{ form_widget(form.username, {'attr': {'class': 'form-control'}}) }}
            <span class="glyphicon glyphicon-user form-control-feedback"></span>
        </div>
        <div class="form-group has-feedback">
            {{ form_errors(form.email) }}
            {{ form_widget(form.email, {'attr': {'class': 'form-control'}}) }}
            <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
        </div>
        <div class="form-group has-feedback">
            {{ form_errors(form.plainPassword.first) }}
            {{ form_widget(form.plainPassword.first, {'attr': {'class': 'form-control'}}) }}
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
        </div>
        <div class="form-group has-feedback">
            {{ form_errors(form.plainPassword.second) }}
            {{ form_widget(form.plainPassword.second, {'attr': {'class': 'form-control'}}) }}
            <span class="glyphicon glyphicon-log-in form-control-feedback"></span>
        </div>
        <div class="row">
            <div class="col-xs-8">
                <div class="checkbox icheck">
                    <label>
                        <input type="checkbox"> I agree to the <a href="#">terms</a>
                    </label>
                </div>
            </div>
            <!-- /.col -->
            <div class="col-xs-4">
                <button type="submit" class="btn btn-primary btn-block btn-flat">Register</button>
            </div>
            <!-- /.col -->
        </div>
    {{ form_end(form) }}
    <a href="{{ path('fos_user_security_login') }}" class="text-center">已经有账号</a>
</div>